#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int n;
const int N = 200010;
int a[N];
long long sum;
int main()
{
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];

    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
        {
            if (i == j)
                break;
            sum += a[i] * a[j];
        }
    cout << sum;

    return 0;
}